We have datasets corresponding to variation in the following parameters of the ligament ensemble
We start by loading the required libraries, and set the plotting styles.
from IPython.core.interactiveshell import InteractiveShell
# pretty print all cell's output and not just the last one
InteractiveShell.ast_node_interactivity = "all"
# Required libraries for data arrays, data manipulation, plotting etc
import numpy as np
import pandas as pd
import seaborn as sns
sns.set_context("poster")
sns.set(rc={'figure.figsize': (16, 9.)})
sns.set_style("whitegrid")
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'retina'
plt.rcParams['text.latex.preamble']=[r"\usepackage{lmodern}",r'\boldmath']
#sns.set(style="white", palette="muted")
#sns.set_context("paper")
This is an example of the images generated from the simulation of an individual ligament.
from IPython.display import Image, display
listOfImageNames = ['../d1/img-snapshot-12.png',
'../d3/img-snapshot-12.png']
for imageName in listOfImageNames:
display(Image(filename=imageName))
Both images are saved at $T=12$, where the top image corresponds to the weaker initial perturbation. Now we load the big dataset.
big_1 = pd.read_csv("../results", sep=" ")
big_1.head()
The area column is not actually area, but for the 3D axisymmetric solver, the dv volume element corresponds to volume per unit radian. Thus, all integral quantities (e.g. drop volume) need to be multiplied by a factor of $2\pi$.
The volume of the ligaments in our case are $\pi R^2 L$, where $R=1$. Thus, $L=2\Lambda$ gives you the initial ligament.
# slicing the old dataset
# d1 : small amp - small aspect
d1 = big_1.loc[(big_1.amplitude == 0.1) & (big_1['aspect-ratio'] == 50)]
#viewing the new dataset
d1.head()
# Checking the volume of the ligaments at time T = 0, mean and std
d1.area.loc[d1.time == 0].mean() , d1.area.loc[d1.time == 0].std()
# slicing the old dataset
# d1 : small amp - small aspect
d3 = big_1.loc[(big_1.amplitude == 0.2) & (big_1['aspect-ratio'] == 50)]
#viewing the new dataset
d3.head()
# Checking the volume of the ligaments at time T = 0, mean and std
d3.area.loc[d3.time == 0].mean() , d3.area.loc[d3.time == 0].std()
Now let us recompute the volume of the drops ("area"), by multiplying with $2\pi$, and recompute the diameters using the new volumes. We create a function that applies this to the dataset.
# Create a function that multiplies volume ("area")
def volume_3d(df):
df.area = df.area * (2.0 * np.pi)
df.diameter = ((6.0*df.area)/np.pi)**(1.0/3.0)
return df
d1_new = d1.apply(volume_3d, axis='columns')
d1_new.head()
d3_new = d3.apply(volume_3d, axis='columns')
d3_new.head()
list_1 = [
'../d1/img-snapshot-12.png',
'../d1/img-snapshot-13.png',
'../d1/img-snapshot-14.png',
'../d1/img-snapshot-15.png',
'../d1/img-snapshot-16.png',
'../d1/img-snapshot-17.png',
]
# display plots from individual ligament simulations for times T=12 to T=17
for imageName in list_1:
display(Image(filename=imageName))
sns.displot(data=d1_new, kind="hist", kde=False, x="diameter", col="time",
legend=True, palette="bright", height=4.0, aspect=1.0, col_wrap=3);
list_2 = [
'../d3/img-snapshot-6.png',
'../d3/img-snapshot-7.png',
'../d3/img-snapshot-8.png',
'../d3/img-snapshot-9.png',
'../d3/img-snapshot-10.png',
'../d3/img-snapshot-11.png',
]
# display plots from individual ligament simulations for times T=12 to T=17
for imageName in list_2:
display(Image(filename=imageName))
sns.displot(data=d3_new, kind="hist", kde=False, x="diameter", col="time",
legend=True, palette="bright", height=4.0, aspect=1.0, col_wrap=3);
Let us compute the values for the equivalent diameters, which can be simply estimated by equating the volume under our discrete wavelengths ($L_i $) to the volume of a drop with diameter $D_i$. Thus we get
$$ \pi D_i^3 /6 = \pi R^2 L_i \implies D_i = (6 L_i R^2 )^{1/3} $$The $i$ in the above equation refers to the discrete wave number, whose wavelength is given by $L_i = L/i$. We also rescale the the diameters with the intial width of the ligament $W$, thus giving us
$$ D_i / W = \left(3\Lambda /2i \right)^{1/3} \,. $$Now, setting $i=1$, we get the maximum possible equivalent diameter, which is the case if the entire ligament collapsed into a single drop. The shortest wavelength which is unstable with respect to Rayleigh-Plateau is given by
$$ i \approx \Lambda/\pi \quad \implies D_\textrm{short}/W \approx 1.68 \,.$$For the optimal (largest growth rate) wavelength of the Rayleigh-Plateau instability, we have
$$ i \approx 0.7 \Lambda/\pi \quad \implies D_\textrm{rp}/W \approx 1.89 \,.$$$\Lambda = 50$ for
d1andd3datasets.
Therefore, we have several interesting values for the equivalent diameters as follows
#initializing values for analysis of d1,d3 datasets
d_max = 4.21
d_rp = 1.89
d_sh = 1.68
d_cut = 1.14
# histogram for d1
sns.displot(data=d1_new.diameter[(d1_new.time == 18)].map(lambda p: p/2.0), kind="hist", kde=False,
legend=True, palette="bright", height=8.0, aspect=1.0,
alpha = 0.5 , color = 'green') ;
# plotting the vertical lines for d_max, d_rp, d_sh, d_cut
plt.axvline(x = d_max, label = r'$D_{\rm{max}}$', color='darkgreen',lw=2.5);
plt.axvline(x = d_rp, label = r'$D_{\rm{rp}}/W$', color='red', lw=2.5);
plt.axvline(x = d_sh, label = r'$D_{\rm{sh}}/W$', color='black', lw=2.5);
plt.axvline(x = d_cut, label = r'$D_{\rm{cut}}/W$', color='blue', lw=2.5);
plt.ylim(top = 30000);
plt.xlim(right = 5.0);
plt.xlabel(r'$D/W$')
plt.legend();
(2.0**(1.0/3.0)) * 2.2